/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package spiele.RPS.xample.pokemon;

import spiele.RPS.RpsChart;
import spiele.RPS.Rps;
import spiele.RPS.factory.RpsFactory;

/**
 *
 * @author martin
 */
public class PokeChart{
  public static final RpsChart<Type,Effective> factory = new RpsFactory<Type,Effective>(Effective.normal);
   
  public static final Rps<Type,Double>[] chart = new Rps[]{
    //normal
    notVeryEffective(Type.normal, Type.rock),
    noEffect(Type.normal, Type.ghost),
    notVeryEffective(Type.normal, Type.steel),
    //fire
    notVeryEffective(Type.fire, Type.fire),
    notVeryEffective(Type.fire, Type.water),
    superEffective(Type.fire, Type.grass),
    superEffective(Type.fire, Type.ice),
    superEffective(Type.fire, Type.bug),
    notVeryEffective(Type.fire, Type.rock),
    notVeryEffective(Type.fire, Type.dragon),
    superEffective(Type.fire, Type.steel),
    //water
    superEffective(Type.water, Type.fire),
    notVeryEffective(Type.water, Type.water),
    notVeryEffective(Type.water, Type.grass),
    superEffective(Type.water, Type.ground),
    superEffective(Type.water, Type.rock),
    notVeryEffective(Type.water, Type.dragon)
    //grass
    //electric
    //ice
    //fighting
    //poison
    //ground
    //flying
    //psychic
    //bug
    //rock
    //ghost
    //dragon
    //dark
    //steel
  };
  
  

  public static Rps<Type, Effective> superEffective(final Type strong, final Type weak){
    return factory.make(strong, weak,Effective.very);
  }
  
  public static Rps<Type, Effective> effective(final Type strong, final Type weak){
    return factory.make(strong, weak,Effective.normal);
  }
 
  public static Rps<Type, Effective> notVeryEffective(final Type strong, final Type weak){
    return factory.make(strong, weak,Effective.notTo);
  }
  
  public static Rps<Type, Effective> noEffect(final Type strong, final Type weak){
    return factory.make(strong, weak,Effective.no);
  }
  
  public static Rps fight(final Type attacker, final Type defender){
    return factory.agaisnt(attacker, defender);
  }
  
  public static Effective tie(){
    return factory.tie();
  }
}
